#include "stdio.h"
#include "stdlib.h"
#include "string.h"

/**
 * 字符串的查找、包含、拼接
 * @return
 */
int main() {

    char *txt = "abcdefg";
    char *sub = "ab";
    char *pop = strstr(txt, sub);
    if (pop) {
        printf("包含%s,查找到了%s\n", sub, pop);
        //获取位置
        int index = pop - txt;
        printf("pop位置是在%d\n", index);
    }

    char strArr[100];
    strcat(strArr, txt);
    strcat(strArr, " cyz");
    printf("拼接之后的字符串是：%s", strArr);

    return 0;
}